package com.ITArmy.controller;

import com.ITArmy.beans.Order;
import com.ITArmy.beans.Shows.SystemMessage;
import com.ITArmy.common.ServerResponse;
import com.ITArmy.controller.base.BaseController;
import com.ITArmy.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

@Api(value = "订单接口层次", tags = "订单接口层次Controller层")
@Controller
@RequestMapping("/order")
public class OrderController extends BaseController {

    @RequestMapping("/findOrderByUId")
    @ResponseBody
    @ApiOperation(value = "通过用户id查找订单信息",
            httpMethod = "POST", response = ServerResponse.class)
    public ServerResponse findOrderByUid(Long uid){
        return orderService.findOrderByUid(uid);
    }

    @RequestMapping("/addOrder")
    @ResponseBody
    @ApiOperation(value = "用户新增订单信息",
            httpMethod = "POST", response = ServerResponse.class)
    public ServerResponse addOrder(HttpServletRequest request,Order order){
        return orderService.addOrder(request,order);
    }

//    @RequestMapping("/informationFollowPage")
//    @ApiOperation(value = "进入消息系统消息页面", httpMethod = "GET")
//    public String informationFollowPage(HttpServletRequest request, Model model) {
//        List<SystemMessage> systemMessages= messageService.getSystem(request);
//        model.addAttribute("systemMessages",systemMessages);
//        return "informationFollow";
//    }

}
